package com.zzzzzz.content.reply;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zzzzzz.content.content.ContentDao;

@Service("replyService")
public class ReplyServiceImpl implements ReplyService {
	@Resource
	private ReplyDao replyDao;
	@Resource
	private ContentDao contentDao;
	
	public void add(Reply reply){
		replyDao.add(reply);
		
		contentDao.editReplies(reply.getTopicId(), 1);
	}
	
	public List<ReplyView> findByTopicId(Long topicId, Integer typeId, int start, int offset){
		return replyDao.findByTopicId(topicId, typeId, start, offset);
	}
	
	public long findByTopicIdCount(Long topicId, Integer typeId){
		return replyDao.findByTopicIdCount(topicId, typeId);
	}
}
